#include "defines.txt"

if (new_room) {
  load.pic(room_no);
  draw.pic(room_no);
  discard.pic(room_no);
  set.horizon(37);
if (has("biri")) {

  load.view(1);
  set.view(o2,1);
  position(o2,52,109);
  animate.obj(o2);
  stop.cycling(o2);
  draw(o2);
}

  if (prev_room_no == 4) {
position(ego,83,112);
}

  draw(ego);
  show.pic();
}
if (said("open","door")) {
  if (posn(o0,78,109,91,111)) {
    new.room(4);
  }
  else {
    print("You are not close enough.");
  }
}
if (said("look")) {
  if(has("biri")){
    print("You see a man lying on the ground");
  }
  else {
    print("You are in front of the graffity store.");
  }
}
  if (said("talk","man")) {
  if(has("biri")){
    print("Man: can ya spare me a biri.");
  }
  else {
  print("you already talked to him?");
  }
}
  if (said("give","biri")) {
  if(has("biri")){
    print("gee thanks man");
    print("and take this if you want to.");
  get("key");
  drop("biri");
     v3 += 4;
  }
  else {
  print("you already gave it to him");
  }
}
if (ego_edge_code == right_edge) {    // ego touching right edge of screen
  new.room(5);
}
if (ego_edge_code == left_edge) {     // ego touching left edge of screen
  new.room(2);
}
if (has("spell book")) {
  if (said("open","book")) {
    print("The spells are as follows-.");
    print("DHOOA: Makes everyone go blind, except you.");
    print("KALI: You can open any door with this one.");
    print("PINKU: You will know the answer to any questions if you use this.");
    print("That's all.");
  }
}
if (has("spell book")) {
  if (said("dhooa")) {
    print("No need of using this now.");
  }
}
if (has("spell book")) {
  if (said("Kali")) {
    print("No need of using this now.");
  }
}
if (has("spell book")) {
  if (said("pinku")) {
    print("No need of using this now.");
  }
}
return();